package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.TemplateFieldAddDTO;
import org.jsola.hr.dto.TemplateFieldUpdateDTO;
import org.jsola.hr.query.TemplateFieldQuery;
import org.jsola.hr.vo.TemplateFieldListVO;
import org.jsola.hr.vo.TemplateFieldVO;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;

/**
 * @author zhr
 */
@Api(tags = "hr-模板字段")
public interface ITemplateFieldControllerAPI {

    /**
     * 新增模板字段
     * @param templateFieldAddDTO 模板字段新增实体
     * @return 模板字段展示对象
     */
    @ApiOperation(value = "新增模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "templateFieldAddDTO", dataType = "TemplateFieldAddDTO", value = "新增模板字段", paramType = "body")
    })
    Result<TemplateFieldVO> save(TemplateFieldAddDTO templateFieldAddDTO);


    /**
     * 修改模板字段
     * @param templateFieldUpdateDTO 模板字段
     * @return 更新数量
     */
    @ApiOperation(value = "修改模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "templateFieldUpdateDTO", dataType = "TemplateFieldUpdateDTO", value = "修改模板字段", paramType = "body")
    })
    Result<Integer> update(TemplateFieldUpdateDTO templateFieldUpdateDTO);




    /**
     * 删除单个模板字段，彻底删除
     * @param templateFieldId 模板字段id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个模板字段，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "templateFieldId", dataType = "String", value = "模板字段id", paramType = "path")
    })
    Result<Integer> delete(String templateFieldId);


    /**
     * 批量删除模板字段，彻底删除
     * @param templateFieldIds 模板字段id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除模板字段，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "templateFieldIds", dataType = "String[]", value = "模板字段id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] templateFieldIds);


    /**
     * 根据模板字段id查询模板字段详情
     * @param templateFieldId 模板字段id
     * @return 模板字段详情
     */
    @ApiOperation(value="根据模板字段id查询模板字段详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "templateFieldId", dataType = "String", value = "模板字段id", paramType = "path")
    })
    Result<TemplateFieldVO> findById(String templateFieldId);


    /**
     * 查询模板字段
     * @param templateFieldQuery 模板字段查询参数
     * @return page
     */
    @ApiOperation(value="查询模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "templateFieldQuery", dataType = "TemplateFieldQuery", value = "模板字段查询参数", paramType = "query")
    })
    Result<List<TemplateFieldListVO>> listAll(TemplateFieldQuery templateFieldQuery);


     /**
     * 分页查询模板字段
     * @param templateFieldQuery 模板字段查询参数
     * @return page
     */
    @ApiOperation(value="分页查询模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "templateFieldQuery", dataType = "TemplateFieldQuery", value = "模板字段查询参数", paramType = "query")
    })
    Result<Page<TemplateFieldListVO>> page(TemplateFieldQuery templateFieldQuery);

    /**
     * 查询员工模板相关所有字段
     * @param templateFieldQuery 模板字段查询参数
     * @return 模板字段列表信息
     */
    @ApiOperation(value="查询员工模板相关所有字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "templateFieldQuery", dataType = "TemplateFieldQuery", value = "模板字段查询参数", paramType = "query")
    })
    Result<Map> fieldListAll(@Valid TemplateFieldQuery templateFieldQuery);
}

